using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace SchoolsBI
{
    public class Persona : iRecord
    {
        private eAcciones mAccion;
        private XmlElement ixml = new xmlDocVariables("Persona").xml();
        public int id;
        public string Nombre;
        public string Apellido;
        public string Nacimiento;
        public string Domicilio;
        public string Telefono;
        public string eMail;
        public string Celular;
        public string NroDocumento;
        public int _accion;
        public  mySQL db= new mySQL(); 

        public Persona()
        {
            
        }
        
        #region iRecord Members

        public int accion
        {
            get
            {
                return _accion;
            }
            set
            {
                _accion=value;
            }
        }

        
        public void Insert()
        {
            string sql = "insert into alumnos (Apellido, Nombre)";
            sql += " values( ";
            sql += "'" + Apellido+ "',";
            sql += "'" + Nombre + "'";
            sql += ")";
            db.execute(sql);
        }

        public void Load()
        {
            db.GetDataSet("select * from alumnos where idalumno=" + this.id);

        }

        public void Delete()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public virtual void Update()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public virtual void Save()
        {
            this.Insert();
        }
         
        #endregion

        #region iRecord Members

        int iRecord.accion
        {
            get
            {
                throw new Exception("The method or operation is not implemented.");
            }
            set
            {
                throw new Exception("The method or operation is not implemented.");
            }
        }

        #endregion
    }

}
